package com.ruoyi.gt.controller;


import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;

import com.ruoyi.gt.domain.GtBookListInfo;
import com.ruoyi.gt.service.IGtBookListInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;


import java.util.List;

/**
 * 图书卡片Controller
 *
 * @author xkang
 * @date 2020-06-19
 */
@RestController
@RequestMapping("/wx-app/gt/book")
public class AppGtBookListInfoController extends BaseController
{
    @Autowired
    private IGtBookListInfoService gtBookListInfoService;

    /**
     * 查询图书卡片列表
     */

    @GetMapping("/list")
    public TableDataInfo list(GtBookListInfo gtBookListInfo)
    {
        startPage();
        List<GtBookListInfo> list = gtBookListInfoService.selectGtBookListInfoList(gtBookListInfo);
        return getDataTable(list);
    }


    /**
     * 获取图书卡片详细信息
     */
    @PreAuthorize("@ss.hasPermi('gt:gtbook:query')")
    @GetMapping(value = "/{bookId}")
    public AjaxResult getInfo(@PathVariable("bookId") Long bookId)
    {
        return AjaxResult.success(gtBookListInfoService.selectGtBookListInfoById(bookId));
    }


}
